import sys
from PyQt4.QtGui import QPushButton

class ImageButton(QPushButton):
	def __init__(self, name, parent, n, h, p, d, *args, **kw):

		ssfmt = """
		QPushButton {{
			background-image : url({0});
			border: 1px solid transparent;
		}}
		QPushButton:hover {{
			background-image : url({1});
		}}
		QPushButton:pressed {{
			background-image : url({2});
		}}
		QPushButton:disabled {{
			background-image : url({3});
		}}
		"""

		QPushButton.__init__(self, parent, *args, **kw)
		self.setObjectName(name)
		ss = ssfmt.format(n, h, p, d)
		self.setStyleSheet(ss)


